package config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Bean方法可能不会反过来创建进一步的配置类（任何此类实例都将被视为常规bean，其配置注释仍未被检测到）。
 *
 * beanName:org.springframework.context.annotation.internalConfigurationAnnotationProcessor
 * beanName:org.springframework.context.annotation.internalAutowiredAnnotationProcessor
 * beanName:org.springframework.context.annotation.internalCommonAnnotationProcessor
 * beanName:org.springframework.context.event.internalEventListenerProcessor
 * beanName:org.springframework.context.event.internalEventListenerFactory
 * beanName:appConfig.AppConfigAux
 * beanName:springConfiguration
 * beanName:getEnglish
 * beanName:getAppConfig
 * config.SpringConfiguration$$EnhancerBySpringCGLIB$$3ee9238b@5d47c63f
 * @Bean
 * public Chinese getChinese() {
 *     return new Chinese();
 *} 不被解析
 *
 */
public class AppConfig {

    @Bean
    public Chinese getChinese() {
        return new Chinese();
    }

    /**正确写法*/
    @Configuration
    static class AppConfigAux {
        @Bean
        public English getEnglish() {
            return new English();
        }
    }
}
